Fix #12689 - Remove unnecessary src=null on WMS tile load error#12691
Draft
offtherailz wants to merge 2 commits into
Draft
Fix #12689 - Remove unnecessary src=null on WMS tile load error#12691offtherailz wants to merge 2 commits into
offtherailz wants to merge 2 commits into
Conversation
…oad error Setting img.src = null does not clear the image; the DOM coerces it to the string "null", causing a real (always-404) network request. image.setState(3) alone already triggers the source's tileloaderror/imageloaderror events (state-based, no DOM event dependency), making the src=null line redundant.
Verifies the tile error handler no longer sets img.src = null on failure.
tdipisa
marked this pull request as draft
July 21, 2026 14:35
Member
|
Converted to draft waiting for 2026.02.00 to be out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12689
Removes
image.getImage().src = null;from the tile load error handler inWMSLayer.js. Assigningnullto an<img>'ssrccoerces to the literal string"null", causing a real (always-404) request to a relative URL namednull.The line immediately after it,
image.setState(3), already sets OpenLayers' internal tile/image state toERROR. Traced throughol/source/UrlTile.js(handleTileChange) andol/source/Image.js(handleImageChange): both dispatchtileloaderror/imageloaderrorpurely based on that internal state, synchronously, with no dependency on the<img>element's nativeerrorDOM event. So thesrc = nullline isn't needed for the error signal MapStore listens for (Map.onLayerError) — it's redundant, and its only effect is the spurious network request.Verified locally: removing the line eliminates the
/nullrequests while the layer's error state andonLayerErrorstill propagate correctly.